package cn.glfs.domain.activity.service;

import cn.glfs.domain.activity.model.aggregate.CreateOrderAggregate;
import cn.glfs.domain.activity.model.entity.ActivityCountEntity;
import cn.glfs.domain.activity.model.entity.ActivityEntity;
import cn.glfs.domain.activity.model.entity.ActivitySkuEntity;
import cn.glfs.domain.activity.model.entity.SkuRechargeEntity;
import cn.glfs.domain.activity.model.valobj.ActivitySkuStockKeyVO;
import cn.glfs.domain.activity.reposity.IActivityRepository;
import cn.glfs.domain.activity.service.rule.factory.DefaultActivityChainFactory;
import org.springframework.stereotype.Service;

@Service
public class RaffleActivityService  extends AbstractRaffleActivity implements ISkuStock {
    public RaffleActivityService(IActivityRepository activityRepository, DefaultActivityChainFactory defaultActivityChainFactory) {
        super(activityRepository, defaultActivityChainFactory);
    }

    @Override
    protected CreateOrderAggregate buildOrderAggregate(SkuRechargeEntity skuRechargeEntity, ActivitySkuEntity activitySkuEntity, ActivityEntity activityEntity, ActivityCountEntity activityCountEntity) {
        return null;
    }

    @Override
    protected void doSaveOrder(CreateOrderAggregate createOrderAggregate) {
        activityRepository.doSaveOrder(createOrderAggregate);
    }

    @Override
    public ActivitySkuStockKeyVO takeQueueValue() throws InterruptedException {
        return activityRepository.takeQueueValue();
    }

    @Override
    public void clearQueueValue() {
        activityRepository.clearQueueValue();
    }

    @Override
    public void updateActivitySkuStock(Long sku) {
        activityRepository.updateActivitySkuStock(sku);
    }

    @Override
    public void clearActivitySkuStock(Long sku) {
        activityRepository.clearActivitySkuStock(sku);
    }
}
